package com.sofwin.service.impl.contents;

import com.github.pagehelper.PageInfo;
import com.sofwin.mapper.CStockMapper;
import com.sofwin.pojo.CStock;
import com.sofwin.pojo.CStockExample;
import com.sofwin.service.contents.CstockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @program: authority-management-system.git
 * @description: TODO
 * @author: Mr.Gao
 * @create: 2021-04-25 15:25
 **/
@Service
public class CstockServiceImpl implements CstockService {

    @Autowired
    private CStockMapper mapper;

    @Override
    public PageInfo<CStock> selectAll(CStock cStock) {

        CStockExample ex = new CStockExample();
        CStockExample.Criteria criteria = ex.createCriteria();
        criteria.andInfoIdEqualTo(cStock.getInfoId());
        List<CStock> cStocks = mapper.selectByExample(ex);
        return new PageInfo<CStock>(cStocks);
    }
}
